{% extends "./base.html" %}
{% block style_litte %}
    <style>
        .main {

        }

        .main > div {
            display: flex;
            justify-content: center;
        {#这是发帖居中的注释#}
        }

        .fa_tie {
            width: 980px;

        }

    </style>
{% endblock %}

{% block content %}
    <script type="text/javascript" src="/static/ckeditor/ckeditor.js"></script>
    {% block nav %}
    {% endblock %}

    <div>
        <form class="fa_tie" action="" method="post">{% csrf_token %}
            {{ form.as_p }}
            <script type="text/javascript">CKEDITOR.replace('content');</script>
            <label for="validate">验证码(区分大小写)：</label><input id="validate" name="validate" type="text"/>


            {#    <img onclick="this.setAttribute('src','/validate/')" src="{% url 'validate' %}" title="点击重新获取"/><br>#}

            <img class="yan_zheng_ma" src="{% url 'validate' %}" alt="" title="点击重新获取!!!!">


            <input type="submit" value="更新/添加">
            <script>
                $(".yan_zheng_ma").on("click", function () {
                    console.log('click!!')
                    $.ajax({
                        type: "GET",
                        url: "{% url 'validate' %}",
                        dataType: "json",
                    });
                    $(".yan_zheng_ma").attr("src", "/validate/");
                });
            </script>
        </form>
    </div>

{% endblock content %}